/* ==========================================================================
   TERMINAL PORTFOLIO - CRT/Hacker Aesthetic
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Terminal Colors */
  --term-bg: #0f1924;
  --term-bg-light: var(--footer-bg-color, rgba(15, 25, 36, 0.9));
  --term-blue: #5ab7e8;
  --term-blue-dim: #096aab;
  --term-blue-bright: #33ceff;
  --term-amber: #d3a41a;
  --term-amber-dim: #d3a41a;
  --term-red: #ff3333;
  --term-purple: #8582C0;
  --term-white: #cccccc;
  --term-gray: #b8b6b4;

  /* Glow Effects */
  --glow-blue: 0 0 5px #5ab7e8, 0 0 10px #5ab7e8, 0 0 20px #5ab7e880, 0 0 40px #5ab7e840;
  --glow-blue-subtle: 0 0 5px #5ab7e880, 0 0 10px #5ab7e840;
  --glow-amber: 0 0 5px #d3a41a, 0 0 10px #d3a41a, 0 0 20px #d3a41a80;
  --glow-text: 0 0 8px currentColor;

  /* Typography */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;

  /* Timing */
  --blink-speed: 1s;
  --type-speed: 50ms;
  --flicker-speed: 0.15s;
}

/* --------------------------------------------------------------------------
   Base Terminal Styles
   -------------------------------------------------------------------------- */
.terminal-page {
  background-color: var(--term-bg);
  color: var(--term-blue);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* CRT Scanlines Overlay */
.terminal-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background: repeating-linear-gradient(
    -60deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );  */
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%) -2px 0,
    linear-gradient(225deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%) -2px 0,
    linear-gradient(315deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%);
  background-size: 4px 4px;

  pointer-events: none;
  z-index: 9999;
}

/* CRT Screen Curvature Effect (subtle) */
.terminal-page::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center,
      transparent 0%,
      transparent 70%,
      rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 9998;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

/* Blinking Cursor */
@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* Screen Flicker */
@keyframes flicker {
  0% {
    opacity: 0.97;
  }

  5% {
    opacity: 0.95;
  }

  10% {
    opacity: 0.97;
  }

  15% {
    opacity: 0.94;
  }

  20% {
    opacity: 0.98;
  }

  50% {
    opacity: 0.96;
  }

  80% {
    opacity: 0.98;
  }

  90% {
    opacity: 0.94;
  }

  100% {
    opacity: 0.97;
  }
}

/* Text Glow Pulse */
@keyframes glow-pulse {

  0%,
  100% {
    text-shadow: var(--glow-blue-subtle);
  }

  50% {
    text-shadow: var(--glow-blue);
  }
}

/* Typing cursor */
@keyframes cursor-blink {

  0%,
  100% {
    border-color: var(--term-blue);
  }

  50% {
    border-color: transparent;
  }
}

/* Boot sequence fade in */
@keyframes boot-in {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scan line moving down */
@keyframes scan {
  0% {
    top: 0%;
  }

  100% {
    top: 100%;
  }
}

/* Glitch effect */
@keyframes glitch {
  0% {
    clip-path: inset(40% 0 61% 0);
    transform: translate(-2px, 2px);
  }

  20% {
    clip-path: inset(92% 0 1% 0);
    transform: translate(2px, -2px);
  }

  40% {
    clip-path: inset(43% 0 1% 0);
    transform: translate(-2px, 2px);
  }

  60% {
    clip-path: inset(25% 0 58% 0);
    transform: translate(2px, -2px);
  }

  80% {
    clip-path: inset(54% 0 7% 0);
    transform: translate(-2px, 2px);
  }

  100% {
    clip-path: inset(58% 0 43% 0);
    transform: translate(0);
  }
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
.term-text {
  color: var(--term-blue);
  text-shadow: var(--glow-blue-subtle);
}

.term-text-dim {
  color: var(--term-blue-dim);
  text-shadow: none;
}

.term-text-bright {
  color: var(--term-blue-bright);
  text-shadow: var(--glow-blue);
}

.term-text-amber {
  color: var(--term-amber);
  text-shadow: var(--glow-amber);
}

.term-text-white {
  color: var(--term-white);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.term-text-gray {
  color: var(--term-gray);
}

.term-text-red {
  color: var(--term-red);
}

.term-text-purple {
  color: var(--term-purple);
}

/* --------------------------------------------------------------------------
   Cursor
   -------------------------------------------------------------------------- */
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.2em;
  background-color: var(--term-blue);
  animation: blink var(--blink-speed) step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
  box-shadow: var(--glow-blue);
}

.cursor--amber {
  background-color: var(--term-amber);
  box-shadow: var(--glow-amber);
}

/* --------------------------------------------------------------------------
   Terminal Window Chrome
   -------------------------------------------------------------------------- */
.term-window {
  background: var(--term-bg-light);
  border: 1px solid var(--term-blue-dim);
  border-radius: 0.5rem;
  box-shadow:
    0 0 20px rgba(90, 183, 232, 0.1),
    inset 0 0 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.term-window__header {
  /* background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%); */
  background: linear-gradient(to top, rgba(24, 37, 53, 0.2) 0%, rgba(24, 37, 53, 0.5215686275) 25%, rgba(24, 37, 53, 0.8509803922) 50%, #182535 75%, #192330 100%);
  padding: 8px 12px;
  border-bottom: 1px solid var(--term-blue-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.term-window__dots {
  display: flex;
  gap: 6px;
}

.term-window__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--term-gray);
}

.term-window__dot--red {
  background: #ff5f56;
}

.term-window__dot--yellow {
  background: #ffbd2e;
}

.term-window__dot--blue {
  background: #27ca40;
}

.term-window__title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--term-gray);
  letter-spacing: 0.05em;
}

.term-window__body {
  padding: 24px;
  min-height: 200px;
}

/* --------------------------------------------------------------------------
   Command Prompt Styles
   -------------------------------------------------------------------------- */
.prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.prompt__user {
  color: var(--term-amber);
  text-shadow: var(--glow-amber);
}

.prompt__at {
  color: var(--term-gray);
}

.prompt__host {
  color: var(--term-purple);
}

.prompt__path {
  color: var(--term-blue-dim);
}

.prompt__symbol {
  color: var(--term-blue-bright);
  margin-right: 0.5em;
  text-shadow: var(--glow-blue);
}

.prompt__command {
  color: var(--term-white);
}

/* Command output */
.output {
  margin-bottom: 1.5em;
  padding-left: 0;
}

.output--indented {
  padding-left: 1em;
}

.output__line {
  display: block;
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   ASCII Art
   -------------------------------------------------------------------------- */
.ascii-art {
  font-family: var(--font-mono);
  font-size: clamp(6px, 1.2vw, 14px);
  line-height: 1.2;
  white-space: pre;
  color: var(--term-blue);
  text-shadow: var(--glow-blue);
  animation: glow-pulse 4s ease-in-out infinite;
}

.ascii-art--large {
  font-size: clamp(8px, 1.5vw, 16px);
}

.ascii-art--amber {
  color: var(--term-amber);
  text-shadow: var(--glow-amber);
}

/* --------------------------------------------------------------------------
   File Listing (ls -la style)
   -------------------------------------------------------------------------- */
.file-list {
  font-size: 14px;
  width: 100%;
}

.file-entry {
  display: grid;
  grid-template-columns: auto 180px 1fr;
  gap: 1em;
  padding: 0.3em 0.5rem;
  border-bottom: 1px solid rgba(90, 183, 232, 0.1);
  transition: background-color 0.2s ease;
  text-decoration: none;
  color: inherit;
  align-items: center;
  width: 100%;
}

.file-entry:hover {
  background-color: rgba(90, 183, 232, 0.05);
}

.file-entry__perms {
  color: var(--term-blue-dim);
}

.file-entry__user,
.file-entry__group {
  color: var(--term-amber);
}

.file-entry__date {
  color: var(--term-gray);
}

.file-entry__name {
  color: var(--term-blue-bright);
  text-shadow: var(--glow-blue-subtle);
}

.file-entry__name--dir {
  color: var(--term-purple);
}

.file-entry__name--exec {
  color: var(--term-blue);
}

/* Responsive file list */
@media (max-width: 768px) {
  .file-entry {
    grid-template-columns: 1fr;
    gap: 0.2em;
    padding: 0.8em 0;
  }

  .file-entry__group,
  .file-entry__date {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   File Entry Image Preview (Glitch Hover)
   -------------------------------------------------------------------------- */

.file-entry {
  position: relative;
}

.file-entry__preview {
  position: fixed;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  max-width: 40vw;
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  transition: opacity 0.15s ease;
}

.file-entry:hover .file-entry__preview {
  opacity: 1;
}

.file-entry__preview-inner {
  position: relative;
  border: 2px solid var(--term-blue-dim);
  border-radius: 0.5rem;
  background: var(--term-bg-light);
  box-shadow:
    0 0 30px rgba(90, 183, 232, 0.3),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.file-entry__preview-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font-size: 0.8em;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.file-entry:hover .file-entry__preview-loading {
  animation: fade-out 0.3s ease 0.5s forwards;
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

.file-entry__preview-img {
  display: block;
  width: 100%;
  height: auto;
  filter:
    grayscale(0.3) contrast(1.1) brightness(0.9);
  opacity: 0;
  animation: none;
  position: relative;
  z-index: 1;
}

.file-entry:hover .file-entry__preview-img {
  animation: glitch-reveal 0.8s ease-out 0.2s forwards;
}

/* Glitch Reveal Animation */
@keyframes glitch-reveal {
  0% {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
  }

  10% {
    opacity: 0.3;
    clip-path: inset(0 0 85% 0);
    transform: translateX(-2px);
  }

  15% {
    transform: translateX(2px);
  }

  20% {
    opacity: 0.5;
    clip-path: inset(0 0 70% 0);
    transform: translateX(-1px);
  }

  25% {
    transform: translateX(1px);
  }

  30% {
    opacity: 0.6;
    clip-path: inset(0 0 55% 0);
  }

  35% {
    transform: translateX(-2px);
  }

  40% {
    opacity: 0.7;
    clip-path: inset(0 0 40% 0);
    transform: translateX(1px);
  }

  50% {
    opacity: 0.8;
    clip-path: inset(0 0 25% 0);
  }

  60% {
    opacity: 0.85;
    clip-path: inset(0 0 15% 0);
    transform: translateX(-1px);
  }

  70% {
    opacity: 0.9;
    clip-path: inset(0 0 8% 0);
    transform: translateX(0);
  }

  80% {
    opacity: 0.95;
    clip-path: inset(0 0 3% 0);
  }

  90% {
    opacity: 0.98;
    clip-path: inset(0 0 0% 0);
  }

  100% {
    opacity: 1;
    clip-path: inset(0 0 0% 0);
    transform: translateX(0);
  }
}

/* CRT Scanlines Overlay on Preview */
.file-entry__preview-scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background: repeating-linear-gradient(-60deg,
      rgba(0, 0, 0, 0.2) 0px,
      rgba(0, 0, 0, 0.2) 1px,
      transparent 1px,
      transparent 3px); */
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%) -2px 0,
    linear-gradient(225deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%) -2px 0,
    linear-gradient(315deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%);
  background-size: 4px 4px;

  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.file-entry:hover .file-entry__preview-scanlines {
  opacity: 1;
  animation: scanline-drift 3s linear infinite;
}

@keyframes scanline-drift {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 0 3px;
  }
}

/* RGB Split Effect (Chromatic Aberration) */
.file-entry__preview-img {
  position: relative;
}

.file-entry:hover .file-entry__preview-img {
  animation:
    glitch-reveal 0.8s ease-out 0.2s forwards,
    rgb-split 0.15s ease infinite;
}

@keyframes rgb-split {

  0%,
  100% {
    text-shadow: none;
    filter:
      grayscale(0.3) contrast(1.1) brightness(0.9);
  }

  25% {
    filter:
      grayscale(0.3) contrast(1.1) brightness(0.9) drop-shadow(2px 0 0 rgba(255, 0, 0, 0.5)) drop-shadow(-2px 0 0 rgba(0, 255, 255, 0.5));
  }

  75% {
    filter:
      grayscale(0.3) contrast(1.1) brightness(0.9) drop-shadow(-1px 0 0 rgba(255, 0, 0, 0.3)) drop-shadow(1px 0 0 rgba(0, 255, 255, 0.3));
  }
}

/* Screen Flicker Effect on Hover */
.file-entry:hover .file-entry__preview-inner {
  animation: preview-flicker 0.1s ease 0.5s;
}

@keyframes preview-flicker {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

/* Mobile: Hide preview */
@media (max-width: 1024px) {
  .file-entry__preview {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Project Cards (cat output style)
   -------------------------------------------------------------------------- */
.project-card {
  border: 1px solid var(--term-blue-dim);
  border-radius: 0.5rem;
  background: rgba(90, 183, 232, 0.02);
  margin-bottom: 2em;
  transition: all 0.3s ease;
}

.project-card:hover {
  border-color: var(--term-blue);
  background: rgba(90, 183, 232, 0.05);
  box-shadow: 0 0 30px rgba(90, 183, 232, 0.1);
}

.project-card__header {
  padding: 0.5em;
  border-bottom: 1px solid var(--term-blue-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-card__title {
  font-size: 1.1em;
  color: var(--term-blue-bright);
  text-shadow: var(--glow-blue);
}

.project-card__meta {
  font-size: 0.8em;
  color: var(--term-gray);
}

.project-card__body {
  padding: 1.5em;
}

/* Project Card Image */
.project-card__image-container {
  position: relative;
  width: 100%;
  margin-bottom: 1.5em;
  border: 1px solid var(--term-blue-dim);
  border-radius: 0.5rem;
  background: var(--term-bg);
  overflow: hidden;
  box-shadow:
    0 0 20px rgba(90, 183, 232, 0.2),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
}

.project-card__image {
  display: block;
  width: 100%;
  height: auto;
  filter:
    grayscale(0.2) contrast(1.15) brightness(0.95);
  transition: filter 0.3s ease;
}

.project-card:hover .project-card__image {
  filter:
    grayscale(0.1) contrast(1.2) brightness(1);
}

.project-card__image-scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background: repeating-linear-gradient(-60deg,
      rgba(0, 0, 0, 0.15) 0px,
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 3px); */
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%) -2px 0,
    linear-gradient(225deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%) -2px 0,
    linear-gradient(315deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%);
  background-size: 4px 4px;

  pointer-events: none;
  z-index: 1;
  animation: scanline-slow-drift 4s linear infinite;
}

@keyframes scanline-slow-drift {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 0 3px;
  }
}

.project-card__description {
  color: var(--term-white);
  margin-bottom: 1em;
  line-height: 1.7;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-bottom: 1em;
}

.project-card__tag {
  font-size: 0.75em;
  padding: 0.2em 0.6em;
  border: 1px solid var(--term-blue-dim);
  border-radius: 0.25rem;
  color: var(--term-blue-dim);
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  color: var(--term-amber);
  text-decoration: none;
  padding: 0.5em 1em;
  border: 1px solid var(--term-amber-dim);
  border-radius: 0.5rem;
  margin-top: 1em;
  transition: all 0.2s ease;
}

.project-card__link:hover {
  background: var(--term-amber);
  color: var(--term-bg);
  text-shadow: none;
}

/* Responsive project card images */
@media (max-width: 768px) {
  .project-card__image-container {
    margin-bottom: 1em;
  }
}

/* --------------------------------------------------------------------------
   Section Styles
   -------------------------------------------------------------------------- */
.term-section {
  padding: 4rem 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.term-section--hero {
  min-height: 100vh;
  justify-content: center;
  position: relative;
}

.term-section--full {
  min-height: auto;
  padding: 2rem 0;
}

.term-container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
}

.term-container--wide {
  max-width: 1200px;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero-boot {
  animation: boot-in 1s ease-out;
}

.hero-boot__content {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.hero-ascii-wrapper {
  flex: 1;
  min-width: 0;
}

.hero-avatar {
  position: relative;
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border: 1px solid var(--term-purple);
  border-radius: 1.75rem;
  overflow: hidden;
  box-shadow:
    0 0 20px rgba(90, 183, 232, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.hero-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter:
    grayscale(0.15) contrast(1.05) brightness(0.95);
  transition: filter 0.3s ease;
}

.hero-avatar:hover .hero-avatar__img {
  filter:
    grayscale(0.05) contrast(1.08) brightness(1);
}

.hero-avatar__scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background: repeating-linear-gradient(-60deg,
      rgba(0, 0, 0, 0.08) 0px,
      rgba(0, 0, 0, 0.08) 1px,
      transparent 1px,
      transparent 3px); */
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%) -2px 0,
    linear-gradient(225deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%) -2px 0,
    linear-gradient(315deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%);
  background-size: 4px 4px;

  pointer-events: none;
  z-index: 1;
  animation: scanline-slow-drift 4s linear infinite;
}

.hero-title {
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 400;
  margin-bottom: 1rem;
  color: var(--term-blue);
  text-shadow: var(--glow-blue);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--term-blue-dim);
  margin-bottom: 2rem;
}

.hero-status {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  font-size: 0.9em;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 1em;
  opacity: 0;
  animation: boot-in 0.5s ease-out forwards;
}

.status-line:nth-child(1) {
  animation-delay: 0.2s;
}

.status-line:nth-child(2) {
  animation-delay: 0.4s;
}

.status-line:nth-child(3) {
  animation-delay: 0.6s;
}

.status-line:nth-child(4) {
  animation-delay: 0.8s;
}

.status-line:nth-child(5) {
  animation-delay: 1.0s;
}

.status-line:nth-child(6) {
  animation-delay: 1.2s;
}

.status-ok {
  color: var(--term-blue);
}

.status-label {
  color: var(--term-gray);
  min-width: 200px;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.term-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #171d25;
  /* border-bottom: 1px solid var(--term-blue-dim); */
  /* 1. Set the border width and style (color gets overridden) */
  border-bottom: 1px solid transparent;
  /* 2. Apply your gradient */
  border-image-source: linear-gradient(to right, var(--term-blue-dim), var(--term-blue-bright), var(--term-blue-dim));
  /* 3. Required to make the gradient border render correctly */
  border-image-slice: 1;

  backdrop-filter: blur(10px);
  padding: 0.5rem 0;
}

.term-nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.term-nav__brand {
  line-height: 0%;
  color: var(--term-blue);
  text-decoration: none;
  font-weight: 500;
  text-shadow: var(--glow-blue-subtle);
}

.term-nav__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.term-nav__link {
  color: var(--term-blue-dim);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: bold;
  transition: all 0.2s ease;
  position: relative;
}

.term-nav__link::before {
  content: '>';
  margin-right: 0.3em;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.term-nav__link:hover {
  color: var(--term-blue);
  text-shadow: var(--glow-blue-subtle);
}

.term-nav__link:hover::before {
  opacity: 1;
}

@media (max-width: 768px) {
  .term-nav__links {
    gap: 1rem;
  }

  .term-nav__link::before {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Links & Buttons
   -------------------------------------------------------------------------- */
.term-link {
  color: var(--term-blue);
  text-decoration: none;
  border-bottom: 1px dashed var(--term-blue-dim);
  transition: all 0.2s ease;
}

.term-link:hover {
  color: var(--term-blue-bright);
  border-bottom-style: solid;
  text-shadow: var(--glow-blue);
}

.term-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.75em 1.5em;
  border: 1px solid var(--term-blue);
  background: transparent;
  color: var(--term-blue);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.term-btn:hover {
  background: var(--term-blue);
  color: var(--term-bg);
  text-shadow: none;
  box-shadow: var(--glow-blue);
}

.term-btn--amber {
  border-color: var(--term-amber);
  color: var(--term-amber);
}

.term-btn--amber:hover {
  background: var(--term-amber);
  box-shadow: var(--glow-amber);
}

/* --------------------------------------------------------------------------
   Typing Effect
   -------------------------------------------------------------------------- */
.typing-text {
  position: relative;
}

.typing-text::after {
  content: '_';
  animation: blink var(--blink-speed) step-end infinite;
}

.typing-text--complete::after {
  display: none;
}

/* For JS-driven typing */
.type-writer {
  display: inline;
}

.type-writer .cursor {
  display: inline-block;
}

/* --------------------------------------------------------------------------
   Dividers & Decorations
   -------------------------------------------------------------------------- */
.term-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      var(--term-blue-dim) 20%,
      var(--term-blue-dim) 80%,
      transparent);
  margin: 3rem 0;
}

.term-comment {
  color: var(--term-gray);
  font-style: italic;
}

.term-comment::before {
  content: '// ';
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.flicker {
  animation: flicker 0.15s infinite;
}

.glow-pulse {
  animation: glow-pulse 2s ease-in-out infinite;
}

.no-select {
  user-select: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Staggered fade in for lists */
.stagger-in>* {
  opacity: 0;
  animation: boot-in 0.5s ease-out forwards;
}

.stagger-in>*:nth-child(1) {
  animation-delay: 0.1s;
}

.stagger-in>*:nth-child(2) {
  animation-delay: 0.2s;
}

.stagger-in>*:nth-child(3) {
  animation-delay: 0.3s;
}

.stagger-in>*:nth-child(4) {
  animation-delay: 0.4s;
}

.stagger-in>*:nth-child(5) {
  animation-delay: 0.5s;
}

.stagger-in>*:nth-child(6) {
  animation-delay: 0.6s;
}

.stagger-in>*:nth-child(7) {
  animation-delay: 0.7s;
}

.stagger-in>*:nth-child(8) {
  animation-delay: 0.8s;
}

.stagger-in>*:nth-child(9) {
  animation-delay: 0.9s;
}

.stagger-in>*:nth-child(10) {
  animation-delay: 1.0s;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .terminal-page {
    font-size: 14px;
  }

  .term-section {
    padding: 3rem 0;
    min-height: auto;
  }

  .term-section--hero {
    min-height: 100vh;
    padding-top: 5rem;
  }

  .hero-boot__content {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .hero-avatar {
    width: 120px;
    height: 120px;
  }

  .ascii-art {
    font-size: clamp(4px, 2vw, 10px);
  }

  .term-window__body {
    padding: 16px;
  }

  .prompt {
    flex-direction: column;
  }

  .status-label {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .term-container {
    width: 95%;
  }

  .ascii-art {
    font-size: clamp(3px, 1.8vw, 8px);
  }

  .hero-title {
    font-size: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {

  .terminal-page::before,
  .terminal-page::after {
    display: none;
  }

  .cursor {
    display: none;
  }

  * {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   Profile Avatar (About Section)
   -------------------------------------------------------------------------- */
.output--profile {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.profile-avatar {
  position: relative;
  flex-shrink: 0;
  width: 220px;
  height: 220px;
  border: 2px solid var(--term-blue-dim);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow:
    0 0 20px rgba(90, 183, 232, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.profile-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter:
    grayscale(0.15) contrast(1.05) brightness(0.95);
  transition: filter 0.3s ease;
}

.profile-avatar:hover .profile-avatar__img {
  filter:
    grayscale(0.05) contrast(1.08) brightness(1);
}

.profile-avatar__scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background: repeating-linear-gradient(-60deg,
      rgba(0, 0, 0, 0.08) 0px,
      rgba(0, 0, 0, 0.08) 1px,
      transparent 1px,
      transparent 3px); */
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%) -2px 0,
    linear-gradient(225deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%) -2px 0,
    linear-gradient(315deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.08) 25%, transparent 25%);
  background-size: 4px 4px;

  pointer-events: none;
  z-index: 1;
  animation: scanline-slow-drift 4s linear infinite;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

@media (max-width: 768px) {
  .output--profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-avatar {
    width: 140px;
    height: 140px;
  }
}

/* --------------------------------------------------------------------------
   Reader Mode - Improved Legibility for Long-form Content
   -------------------------------------------------------------------------- */
.reader-mode {
  /* Switch from terminal aesthetics to readable typography */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: #e0e0e0;

  /* Optimal reading width */
  max-width: 70ch;
  margin: 0 auto;
  padding: 2rem 0;

  /* Remove terminal glow effects */
  text-shadow: none;
}

/* Reader mode transition divider */
.reader-mode-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      var(--term-blue-dim) 20%,
      var(--term-blue-dim) 80%,
      transparent);
  margin: 2rem 0 3rem 0;
  opacity: 0.5;
}

/* Reader mode typography */
.reader-mode p {
  margin: 1.5em 0;
  color: #e0e0e0;
  text-shadow: none;
}

.reader-mode h1,
.reader-mode h2,
.reader-mode h3,
.reader-mode h4,
.reader-mode h5,
.reader-mode h6 {
  font-family: 'JetBrains Mono', monospace;
  color: var(--term-blue);
  text-shadow: 0 0 3px rgba(90, 183, 232, 0.3);
  margin: 2em 0 0.75em 0;
  line-height: 1.4;
  font-weight: 600;
}

.reader-mode h1 {
  font-size: 2rem;
  margin-top: 0;
}

.reader-mode h2 {
  font-size: 1.6rem;
}

.reader-mode h3 {
  font-size: 1.3rem;
}

.reader-mode h4 {
  font-size: 1.1rem;
}

/* Links with blue accent */
.reader-mode a {
  color: var(--term-blue-bright) !important;
  text-decoration: underline !important;
  text-decoration-color: var(--term-blue-bright);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: all 0.2s ease;
  text-shadow: none;
}

.reader-mode a:hover {
  color: var(--term-blue) !important;
  text-decoration-color: var(--term-blue);
  text-shadow: 0 0 8px rgba(90, 183, 232, 0.5);
  text-decoration-thickness: 2px;
}

.reader-mode a:visited {
  color: var(--term-blue-dim);
  text-decoration-color: var(--term-blue-dim);
}

/* Emphasis */
.reader-mode strong {
  color: #f0f0f0;
  font-weight: 600;
}

.reader-mode em {
  color: #f0f0f0;
  font-style: italic;
}

/* Code - keep terminal aesthetic */
.reader-mode code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(90, 183, 232, 0.1);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  color: var(--term-blue-bright);
  border: 1px solid rgba(90, 183, 232, 0.2);
}

.reader-mode pre {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 0, 0, 0.4);
  padding: 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--term-blue-dim);
  line-height: 1.6;
}

.reader-mode pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  border: none;
  font-size: 0.95em;
}

/* Lists */
.reader-mode ul,
.reader-mode ol {
  margin: 1.5em 0;
  padding-left: 2em;
}

.reader-mode li {
  margin: 0.75em 0;
  color: #e0e0e0;
}

.reader-mode ul li::marker {
  color: var(--term-blue);
}

.reader-mode ol li::marker {
  color: var(--term-blue);
  font-weight: 600;
}

/* Nested lists */
.reader-mode li>ul,
.reader-mode li>ol {
  margin: 0.5em 0;
}

/* Blockquotes */
.reader-mode blockquote {
  border-left: 3px solid var(--term-blue);
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: #b8b8b8;
  font-style: italic;
  font-size: 1.05em;
}

.reader-mode blockquote p {
  color: #b8b8b8;
}

/* Horizontal rules */
.reader-mode hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      var(--term-blue-dim) 20%,
      var(--term-blue-dim) 80%,
      transparent);
  margin: 3rem 0;
}

/* Images */
.reader-mode img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 4px;
  border: 1px solid var(--term-blue-dim);
  display: block;
}

/* Tables */
.reader-mode table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95em;
}

.reader-mode th,
.reader-mode td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--term-blue-dim);
  text-align: left;
}

.reader-mode th {
  background: rgba(90, 183, 232, 0.1);
  color: var(--term-blue-bright);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.reader-mode td {
  color: #e0e0e0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .reader-mode {
    font-size: 17px;
    line-height: 1.75;
    padding: 1.5rem 0;
  }

  .reader-mode h1 {
    font-size: 1.75rem;
  }

  .reader-mode h2 {
    font-size: 1.4rem;
  }

  .reader-mode h3 {
    font-size: 1.2rem;
  }

  .reader-mode pre {
    padding: 1rem;
    margin: 1.5rem -1rem;
    border-radius: 0;
  }
}

@media (max-width: 480px) {
  .reader-mode {
    font-size: 16px;
    line-height: 1.7;
  }

  .reader-mode h1 {
    font-size: 1.5rem;
  }

  .reader-mode h2 {
    font-size: 1.3rem;
  }
}